cmake_minimum_required(VERSION 3.16)

project(PatientManagerWidget LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets)

add_library(PatientManagerWidget SHARED
  PatientManagerWidget_global.h
  PatientManagerWidget.cpp
  PatientManagerWidget.h
  LeftWidget.h LeftWidget.cpp
  RightUserWidget.h RightUserWidget.cpp
  # PatientInfoLittleWidget.h PatientInfoLittleWidget.cpp
  SearchWidget.h SearchWidget.cpp
  CaseInfoLittleWidget.h CaseInfoLittleWidget.cpp
  PatientListWidget.h PatientListWidget.cpp
  PatientDelegate.h PatientDelegate.cpp
  EditPatientInfo.h EditPatientInfo.cpp
  CalendarComboBoxLikeWidget.h CalendarComboBoxLikeWidget.cpp
  DeletePatient.h DeletePatient.cpp

  # PatientModel.h PatientModel.cpp
)

target_link_libraries(PatientManagerWidget PRIVATE
  Qt${QT_VERSION_MAJOR}::Core
  Qt${QT_VERSION_MAJOR}::Widgets
  BaseWidgets
  UserRepository
  LoadPatientList
)

target_compile_definitions(PatientManagerWidget PRIVATE PATIENTMANAGERWIDGET_LIBRARY)
